﻿namespace EasyWeb
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;

    internal static partial class EWHelpers
    {
        public static void AddRange<T>(this ICollection<T> instance, IEnumerable<T> collection)
        {
            EWDebug.IsNotNull(instance, "instance");
            EWDebug.IsNotNull(collection, "collection");

            foreach (T item in collection)
            {
                instance.Add(item);
            }
        }

        public static bool IsNullOrEmpty<T>(this IEnumerable<T> instance)
        {
            return instance == null || instance.Count() == 0;
        }
    }
}
